//
//  ViewController.m
//  导航控制器
//
//  Created by apple on 15/9/16.
//  Copyright (c) 2015年 戴维营. All rights reserved.
//

#import "ViewController.h"

#import "ScondViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.view.backgroundColor = [UIColor orangeColor];
    
    UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(100, 120, 100, 60)];
    [button setTitle:@"下一个页面" forState:UIControlStateNormal];
//    button.titleLabel.textColor = [UIColor blueColor];
    [button setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];


    [button addTarget:self action:@selector(didClicked:) forControlEvents:UIControlEventTouchUpInside];
    
    
//    button.b = [UIColor whiteColor];
    
    
    [self.view addSubview:button];
    
}

//- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
//{
- (void)didClicked:(UIButton *)sender
{
    ScondViewController *scondView = [[ScondViewController alloc] init];
    
    //页面进栈
    
    [self.navigationController pushViewController:scondView animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
